#ifndef __FFMPEG_CONFIG__
#define __FFMPEG_CONFIG__

extern "C" // 一定一定一定要用extern C  不然g++连接的时候会失败
{
#include "libavcodec/avcodec.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavutil/timestamp.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libswresample/swresample.h"
#include "libavutil/time.h"
}

#include "rkmedia_module_config.h"

#include <iostream>
using namespace std;

#define FLV_PROTOCOL 0
#define TS_PROTOCOL 1

typedef struct
{
    AVStream *stream;
    AVPacket *pkt;
    AVCodecContext *ctx;
    int64_t timestamp = 0;
} OutputStream;

typedef struct
{
    unsigned int index;
    int u32Width;
    int u32Height;
    int protocol;
    char nAddr[128];
    enum AVCodecID video_codec;
    enum AVCodecID audio_codec;
    OutputStream video_stream;
    OutputStream audio_stream;
    AVFormatContext *fmt_ctx;
} ffmpegInfo;

int init_rkmedia_ffmpeg_context(ffmpegInfo *ffmpeg_config);
int free_stream(OutputStream *ost);

#endif